Understanding The Data -- Minecraft Mining
A Deep Dive into the Distribution of Blocks in Minecraft
What is the Optimal Method to Mine in Minecraft
To answer this question we must first collect data. To do this I created a minecraft mod that randomly teleports the player, samples a 500x50x500 (X,Y,Z) set of blocks around the player and logs those blocks into a csv. It repeats this a total of 10 times creating 10 samples of 500x50x500 blocks
The mod can be seen here: https://github.com/JPrier/MinecraftBlocksDistribution
import pandas as pd
import plotly.express as px
from IPython.display import HTML
# Get blocks that we care about
importantBlocks = ['coal_ore', 'gold_ore', 'iron_ore', 'diamond_ore', 'lapis_ore', 'redstone_ore', 'emerald_ore']
df_blocks = df.loc[df['Block'].isin(importantBlocks)]
# Create distribution plots of block vs Y level
fig = px.histogram(df_blocks, x="Y", color="Block")
# HTML(fig.to_html(include_plotlyjs='cdn'))
# HeatMaps of blocks
# adjust samples to be same distance from player
df_blocks["XFromPlayer"] = (df_blocks["playerX"] - df_blocks["X"]).abs()
df_blocks["ZFromPlayer"] = (df_blocks["playerZ"] - df_blocks["Z"]).abs()
df_emerald = df_blocks.loc[df_blocks['Block'] == 'emerald_ore']
fig = px.density_heatmap(df_blocks, x="XFromPlayer", y="Y")
fig = px.scatter_3d(df_blocks, x='XFromPlayer', y='Y', z='ZFromPlayer', color='Block')
HTML(fig.to_html(include_plotlyjs='cdn'))